//package edu.gdit.health.controller;
//
//import edu.gdit.health.base.result.Results;
//
//import edu.gdit.health.service.LoggingEventService;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//@Controller
//@RequestMapping("/logging")
//public class LoggingEventController {
//    @Autowired
//    LoggingEventService loggingEventServiceImpl;
//    @RequestMapping(value = "/list")
//    @ResponseBody
////@RequestBody主要用来接收前端传递给后端的json字符串中的数据的(请求体中的数据的)；GET方式无请求体，所以使用@RequestBody接收数据时，前端不能使用GET方式提交数据，而是用POST方式进行提交。
//    public Results list(int page,int limit){//spring mvc框架会自动获取参数赋值
//        int offset=(page-1)*limit;
//        //调用service层的对象sysReportServiceImpl的addSysReport方法，添加一条数据
//        return loggingEventServiceImpl.getLogging(offset,limit);
//    }
//}
package edu.gdit.health.controller;

import edu.gdit.health.base.result.Results;
import edu.gdit.health.service.LoggingEventService;
import edu.gdit.health.service.Impl.LoggingEventServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/logging")
public class LoggingEventController {
    @Autowired
    LoggingEventService loggingEventServiceImpl;


    @RequestMapping(value = "/list")
    @ResponseBody
    public Results list(int page,int limit){
        int offset=(page-1)*limit;
        return loggingEventServiceImpl.getLogging(offset,limit);
    }

}
